﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace WebApiTest.Models
{
    [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
    public class DB : DbContext
    {
        /// <summary>
        /// name=DBConnection，DBConnection为数据库连接的名字，即web.config配置文件节点connectionStrings，name值为DBConnection的数据库连接字符串
        /// </summary>
        public DB() : base("name=DBConnection")
        {

        }

        #region 配置所有的数据库表

        public DbSet<TestUser> TestUsers { set; get; }

        public DbSet<TestStudent> TestStudents { set; get; }

        public DbSet<TestClass> TestClasss { set; get; }
        #endregion
    }
}